home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 January / EnterCD 0105.iso / Internet / Norton Internet Security 2005 / NIS_Retail.EXE / Setup / PControl / APP / pcwiz.dll / HTML / WIZ-NAVIGATION.JS < prev    next >
Encoding:
JavaScript  |  2004-08-31  |  8.7 KB  |  407 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    iw-Navigation.js (Javascript file for iw-Navigation.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. // Move these global vairables to the top.
  12. var iBackOff = 0;
  13. var iBackOn = 4;
  14. var iNextOff = 0;
  15. var iNextOn = 2;
  16. var iCloseOff = 0;
  17. var iCloseOn = 1;
  18.  
  19. function dprintf(str)
  20. {
  21.     //alert(str);
  22. }
  23.  
  24. function OnKeyDownHandler()
  25. {
  26.     // Last Control Tab over to the <back, next, close> button.
  27.     var VK_ESCAPE = 27;
  28.  
  29.     if (window.event.keyCode == VK_ESCAPE)
  30.     {
  31.         // Escape key.. We want to exit out of the wizard..
  32.         parent.window.navigate("res://closeme.xyz");
  33.  
  34.     }
  35.     
  36. }
  37.  
  38. function OnTabOverNext()
  39. {
  40.     // Last Control Tab over to the <back, next, close> button.
  41.     var VK_TAB = 9;
  42.     if (window.event.keyCode == VK_TAB)
  43.     {
  44.         if(CloseB.disabled == true)
  45.             window.parent.frames("bottom",0).focus();
  46.     }    
  47.     
  48.     
  49. }
  50.  
  51. function OnFocus()
  52. {
  53.     if(BackB.disabled == false)
  54.         BackB.focus();
  55.     else
  56.     {
  57.         if(!NextB.disabled)
  58.             NextB.focus();
  59.         else
  60.             FinishB.focus();
  61.         
  62.     }
  63. }
  64.  
  65. function OnTabOverClose()
  66. {
  67.     // Last Control Tab over to the <back, next, close> button.
  68.     var VK_TAB = 9;
  69.     if (window.event.keyCode == VK_TAB)
  70.     {
  71.         window.parent.frames("contents",0).focus();    
  72.     }
  73.     
  74. }
  75.  
  76. function OnLoad()
  77. {
  78.  
  79.     SetWizardButtons(iBackOff, iNextOn, iCloseOn);
  80.  
  81.     if(BackB.disabled == false)
  82.         BackB.focus();
  83.     else
  84.     {
  85.         if(!NextB.disabled)
  86.             NextB.focus();
  87.         else
  88.             FinishB.focus();
  89.         
  90.     }
  91.  
  92. }
  93.  
  94. function SetContent(pPane)
  95. {
  96.     if (pPane  != null)    
  97.     {
  98.         SetHighlight(pPane);
  99.         SetHeadingHighlight(pPane);
  100.         window.parent.frames("main",0).navigate(pPane.m_htm)
  101.         
  102.         // Set Next and Back Buttons
  103.         if(pPane.m_pNextLink == null)    // Remove Close, Change Next
  104.             SetWizardButtons(iBackOn, iNextOff, iCloseOff);
  105.         else  if(pPane.m_pPreviousLink == null)    // Remove Back
  106.             SetWizardButtons(iBackOff, iNextOn, iCloseOn);
  107.         else
  108.             SetWizardButtons(iBackOn, iNextOn, iCloseOn);            
  109.     
  110.     }
  111.     else
  112.         parent.window.navigate("res://closeme.xyz");
  113. }
  114.  
  115. function GoNext(docTitle)
  116. {
  117.  
  118.     // MessageBox() Flags
  119.     var MB_OK =                     0x00000000;
  120.     var MB_OKCANCEL =               0x00000001;
  121.     var MB_ABORTRETRYIGNORE =       0x00000002;
  122.     var MB_YESNOCANCEL =            0x00000003;
  123.     var MB_YESNO =                  0x00000004;
  124.     var MB_RETRYCANCEL =            0x00000005;
  125.     
  126.     var MB_ICONHAND =               0x00000010;
  127.     var MB_ICONQUESTION =           0x00000020;
  128.     var MB_ICONEXCLAMATION =        0x00000030;
  129.     var MB_ICONASTERISK  =          0x00000040;
  130.     
  131.     var MB_USERICON =               0x00000080;
  132.     var MB_ICONWARNING =            MB_ICONEXCLAMATION;
  133.     var MB_ICONERROR =              MB_ICONHAND;
  134.     
  135.     var MB_ICONINFORMATION =        MB_ICONASTERISK;
  136.     var MB_ICONSTOP =               MB_ICONHAND;
  137.     
  138.     var IDOK =              1;
  139.     var IDCANCEL =          2;
  140.     var IDABORT =           3;
  141.     var IDRETRY =           4;
  142.     var IDIGNORE =          5;
  143.     var IDYES =             6;
  144.     var IDNO =              7;
  145.  
  146.     // Pages GoNext Routines
  147.     // Check for null object if the page hasn't been loaded yet.. This is for all those Fast and Furious clickers out there
  148.     if (parent.window.frames("main",0).Page_GoNext == null)
  149.         return
  150.     else if (parent.window.frames("main",0).Page_GoNext() != true)
  151.         return;
  152.         
  153.     var iMsgBoxReturn;
  154.     var Contents = window.parent.frames("contents",0);
  155.  
  156.     if (docTitle == "Summary")
  157.     {
  158.         parent.window.navigate("res://closeme.xyz");
  159.         return
  160.     }
  161.     else 
  162.     {
  163.         // Check to see object exist..  Need this to fix bug where objects aren't ready in other frames
  164.         var pNextPane = Contents.FindPane(docTitle);
  165.         if (pNextPane == null)
  166.             return;
  167.             
  168.         pNextPane = pNextPane.m_pNextLink;
  169.         SetContent(pNextPane);
  170.  
  171.     }
  172.     
  173. }
  174.  
  175. function GoBack(docTitle)
  176. {
  177.     
  178.     // Pages GoBack Routines
  179.     // Check for null object if the page hasn't been loaded yet.. This is for all those Fast and Furious clickers out there
  180.     if (parent.window.frames("main",0).Page_GoBack == null)
  181.         return
  182.     else if (parent.window.frames("main",0).Page_GoBack() != true)
  183.         return;
  184.         
  185.     var Contents = window.parent.frames("contents",0);
  186.     var pPreviousPane = Contents.FindPane(docTitle);
  187.     
  188.     if (pPreviousPane == null)
  189.         return;
  190.  
  191.  
  192.  
  193.     pPreviousPane = pPreviousPane.m_pPreviousLink;
  194.     SetContent(pPreviousPane);
  195.     
  196. }
  197.  
  198.  
  199. // Back:0 - Back Disabled     Back:1 - Back Enabled
  200. // Next:0 - "Finish" Button     Next:1 - Next Enabled
  201. // Close:0 - Close Disabled     Close:1 - Close Enabled
  202. // Function to Set Navigation Buttons
  203. function SetWizardButtons(iBack, iNext, iClose)
  204. {
  205.     var iWizardButtons = iBack + iNext + iClose;
  206.  
  207.     switch(iWizardButtons)
  208.  
  209.     {
  210.         case 0:
  211.             // Back:0, Next:0, Close:0
  212.             BackB.disabled = true;
  213.             
  214.             NextB.disable = true;
  215.             NextB.style.display = "none";
  216.             FinishB.disable = false;
  217.             FinishB.style.display = "";
  218.             
  219.             CloseB.disabled = true;
  220.             break;
  221.  
  222.         case 2:
  223.             // Back:0, Next:1, Close:0
  224.             BackB.disabled = true;
  225.             
  226.             NextB.disable = false;
  227.             NextB.style.display = "";            
  228.             FinishB.disable = true;
  229.             FinishB.style.display = "none";
  230.     
  231.             CloseB.disabled = true;
  232.             break;
  233.  
  234.         case 3:
  235.             // Back:0, Next:1, Close:1
  236.             BackB.disabled = true;
  237.             
  238.             NextB.disable = false;
  239.             NextB.style.display = "";            
  240.             FinishB.disable = true;
  241.             FinishB.style.display = "none";
  242.             
  243.             CloseB.disabled = false;
  244.             break;
  245.  
  246.         case 4:
  247.             // Back:1, Next:0, Close:0
  248.             BackB.disabled = false;
  249.             
  250.             NextB.disable = true;
  251.             NextB.style.display = "none";
  252.             FinishB.disable = false;
  253.             FinishB.style.display = "";    
  254.             
  255.             CloseB.disabled = true;
  256.             break;
  257.  
  258.         case 5:
  259.             // Back:1, Next:0, Close:1
  260.             BackB.disabled = false;
  261.             
  262.             NextB.disable = true;
  263.             NextB.style.display = "none";
  264.             FinishB.disable = false;
  265.             FinishB.style.display = "";    
  266.             
  267.             CloseB.disabled = false;
  268.             break;
  269.  
  270.  
  271.         case 6:
  272.             // Back:1, Next:1, Close:0
  273.             BackB.disabled = false;
  274.             
  275.             NextB.disable = false;
  276.             NextB.style.display = "";            
  277.             FinishB.disable = true;
  278.             FinishB.style.display = "none";            
  279.             
  280.             CloseB.disabled = true;
  281.             break;
  282.  
  283.         case 7:
  284.             // Back:1, Next:1, Close:1;
  285.             BackB.disabled = false;
  286.             
  287.             NextB.disable = false;
  288.             NextB.style.display = "";            
  289.             FinishB.disable = true;
  290.             FinishB.style.display = "none";        
  291.             
  292.             CloseB.disabled = false;
  293.             break;
  294.  
  295.     }
  296. }
  297.  
  298.  
  299. function SetHeadingHighlight(pPane)
  300. {
  301.  
  302.     var Contents = window.parent.frames("contents",0);
  303.     SetVisible(false, Contents.AccountModeHeadingPane);
  304.     SetVisible(false, Contents.WindowsManagedHeadingPane);    
  305.     SetVisible(false, Contents.ApplicationManagedHeadingPane);    
  306.     SetVisible(false, Contents.SummaryHeadingPane);
  307.     
  308.     SetVisible(true, pPane);
  309. }
  310.  
  311. function SetHighlight(pPane)
  312. {
  313.  
  314.  
  315.     var Contents = window.parent.frames("contents",0);
  316.     
  317.  
  318.     if (Contents.SetTypePane.m_bPageOn  ==  true)
  319.         SetVisible(false, Contents.SetTypePane);    
  320.  
  321.     if (Contents.SupervisorPane.m_bPageOn  ==  true)
  322.         SetVisible(false, Contents.SupervisorPane);
  323.     
  324.     if (Contents.CreateAccountsPane.m_bPageOn  ==  true)
  325.         SetVisible(false, Contents.CreateAccountsPane);
  326.             
  327.     if (Contents.SetPasswordPane.m_bPageOn  ==  true)        
  328.         SetVisible(false, Contents.SetPasswordPane);
  329.         
  330.     if (Contents.DefaultAccountPane.m_bPageOn  ==  true)    
  331.         SetVisible(false, Contents.DefaultAccountPane); 
  332.  
  333.     SetVisible(true, pPane);     
  334.     
  335. }
  336.  
  337.  
  338. function SetVisible(bHighlight, pPane)
  339. {
  340.  
  341.     if(bHighlight)
  342.     {
  343.         pPane.m_hID.style.display = "";
  344.         pPane.m_ID.style.display = "none";
  345.         pPane.m_HLHeading.style.display = "";
  346.         pPane.m_Heading.style.display = "none";
  347.     }
  348.     else
  349.     {
  350.         pPane.m_hID.style.display = "none";
  351.         pPane.m_ID.style.display = "";
  352.         pPane.m_HLHeading.style.display = "none";
  353.         pPane.m_Heading.style.display = "";
  354.     }  
  355. }
  356.  
  357. function BackB_OnClick()
  358. {
  359.     try
  360.     {
  361.         BackB.disabled = true;
  362.         
  363.     var docTitle = window.parent.frames("main",0).document.title;
  364.         
  365.     GoBack(docTitle);
  366.         
  367.         if ((docTitle != "Set Type") && (docTitle != "Supervisor"))
  368.         {
  369.             BackB.disabled = false;
  370.         }
  371.     }
  372.     catch(err)
  373.     {
  374.        BackB.disabled = false;    
  375.        return;
  376.     }
  377. }
  378.  
  379. function NextB_OnClick()
  380. {
  381.     try
  382.     {
  383.         // Disable NextButton so user cannot constantly click next.
  384.         NextB.disabled = true;
  385.         
  386.     GoNext(window.parent.frames("main",0).document.title);
  387.         
  388.         NextB.disabled = false;
  389.     }
  390.     catch(err)
  391.     {
  392.         NextB.disabled = false;
  393.         return;
  394.     }
  395. }
  396.  
  397. function CloseB_OnClick()
  398. {
  399.     parent.window.navigate("res://closeme.xyz");
  400. }
  401.  
  402.  
  403. function WrapNisum_OnProductEnabledChange()
  404. {
  405.     if(WrapNisum.ProductEnabled == "unloaded")
  406.         CloseB_OnClick();
  407. }